home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tlxinstl.zip / ASSEMBLY.MAC next >
Text File  |  1991-01-15  |  21KB  |  721 lines

  1.  
  2. ;******************************   MACROS   ***********************************
  3.  
  4. INPUT   MACRO   field,dlen,mrow,mcol,mscrn
  5. local key,next_key,get_key,exit_bridge,unprintable,bsp,_cr,exit,help,restore,_23,_71,_3f,next_key_bridge,_0f,_1e,_44,_49,_51
  6.         mov   field_start,di
  7.         calc_addr mrow,mcol
  8.         cursor       ;;position cursor and return attribute and character in bx
  9.         push    ax
  10.         mov     ax,dlen
  11.         mov     cx,col
  12.         add     ax,cx
  13.         mov     cx,ax          ;;get absolute column for end of field
  14.         pop     ax
  15. next_key:
  16.         CALL    GETKEY          ;;READ CHARACTER FROM KEYBOARD
  17.         cmp     ah,0DH         ;;if carriage return go get next field
  18.         jne     _0f
  19.         jmp     _cr
  20. _0f:
  21.         cmp     ah,0FH         ;;if left tab go back to previous field
  22.         jne     _44
  23.         jmp     _cr
  24. _44:
  25.         cmp     ah,44H          ;;if F10
  26.         jne     _51
  27.         jmp     help
  28. _51:
  29.         cmp     ax,51feh        ;;if Page down
  30.         jne     _49
  31.         je      exit_bridge
  32. _49:
  33.         cmp     ax,49feh        ;;if Page up
  34.         jne     _71
  35.         je      exit_bridge
  36. _71:
  37.         cmp     ah,71H          ;;if AF10
  38.         jne     _3f
  39.         jmp     exit_bridge
  40. next_key_bridge:
  41.         jmp     next_key
  42. _3f:
  43.         cmp     ah,3FH          ;;if F5
  44.         je      next_key_bridge
  45.         cmp     ah,40H          ;;if F6
  46.         je      next_key_bridge
  47.         cmp     ah,41H          ;;if F7
  48.         je      next_key_bridge
  49.         cmp     ah,42H          ;;if F8
  50.         je      next_key_bridge
  51.         cmp     ah,43H          ;;if F9
  52.         je      next_key_bridge
  53.         cmp     ah,3BH          ;;if F1
  54.         je      exit_bridge
  55.         cmp     ah,3CH          ;;if F2
  56.         je      exit_bridge
  57.         cmp     ah,3DH          ;;if F3
  58.         je      exit_bridge
  59.         cmp     ah,3EH          ;;if F4
  60.         je      exit_bridge
  61.         cmp     al,0            ;;al = 0 if printable character
  62.         jne     unprintable
  63.         cmp     col,cx
  64.         jne     key            ;;go get next character
  65.         dec     col
  66.         jmp     next_key_bridge
  67. key:
  68.         jmp     next_key_bridge
  69. exit_bridge:
  70.         jmp     _cr
  71. help:
  72.         push    dx
  73.         mov     dx,offset mscrn
  74.         call    wakevid                 ;;macro call
  75.         pop     dx
  76.         jmp     next_key_bridge
  77. unprintable:
  78.         jmp     next_key_bridge
  79. ;
  80. _CR:
  81.         push    ax
  82.         mov   field_stop,di
  83.         mov   row,mrow
  84.         mov   col,mcol
  85.         cursor
  86.         STORE_FIELD  field,dlen
  87.         pop     ax
  88. exit:
  89.         func_key
  90.         endm
  91.  
  92. dsklf   macro
  93.         mov     dx,offset linefd      ;;writeline feed to file
  94.         mov     cx,1
  95.         mov     bx,outfile_handle
  96.         mov     ax,4000H
  97.         int     21H                    ;;write to file
  98.         endm
  99.  
  100. dskcrlf macro
  101.         mov     dx,offset crlf          ;;load carriage return,line feed
  102.         mov     cx,2
  103.         mov     bx,outfile_handle
  104.         mov     ax,4000H
  105.         int     21H                     ;;write to file
  106.         endm
  107.  
  108. open            macro   fcb                     ;;open file
  109.                 mov     dx,offset fcb
  110.                 mov     ax,0F00H
  111.                 int     21H
  112.                 endm
  113.  
  114. close           macro   fcb                     ;;open file
  115.                 mov     dx,offset fcb
  116.                 mov     ax,1000H
  117.                 int     21H
  118.                 endm
  119.  
  120. set_dta         macro   buffer                  ;;set disk transfer area
  121.                 mov     dx,offset buffer
  122.                 mov     ax,1A00H
  123.                 int     21H
  124.                 endm
  125.  
  126. read_ran        macro   fcb                     ;;random read
  127.                 mov     dx,offset fcb
  128.                 mov     ax,2100H
  129.                 int     21H
  130.                 endm
  131.  
  132. write_ran       macro   fcb                     ;;random write
  133.                 mov     dx,offset fcb
  134.                 mov     ax,2200H
  135.                 int     21H
  136.                 endm
  137.  
  138. size_file       macro   fcb
  139.                 mov     dx,offset fcb
  140.                 mov     ax,2300H
  141.                 int     21H
  142.                 endm
  143.  
  144. set_relatice_record     macro   fcb
  145.                 mov     dx,offset fcb
  146.                 mov     ax,2400H
  147.                 int     21H
  148.                 endm
  149.  
  150. set_vector      macro   interrupt,handler_start
  151.                 mov     al,interrupt
  152.                 mov     dx,offset handler_start
  153.                 mov     ax,2500H
  154.                 int     21H
  155.                 endm
  156.  
  157. ran_block_read  macro   fcb,count,rec_size
  158.                 mov     dx,offset fcb
  159.                 mov     cx,count
  160.                 mov     word ptr fcb[14],rec_size
  161.                 mov     ax,2700H
  162.                 int     21H
  163.                 endm
  164.  
  165. ran_block_write macro   fcb,count,rec_size
  166.                 mov     dx,offset fcb
  167.                 mov     cx,count
  168.                 mov     word ptr fcb[14],rec_size
  169.                 mov     dx,offset fcb
  170.                 mov     ax,2800H
  171.                 int     21H
  172.                 endm
  173.  
  174. parse           macro   string,fcb
  175.                 mov     si,offset string
  176.                 mov     di,offset fcb
  177.                 push    es
  178.                 push    ds
  179.                 pop     es
  180.                 mov     ax,290FH        ;;bits 0, 1, 2, 3 on
  181.                 int     21H
  182.                 pop     es
  183.                 endm
  184.  
  185. get_date        macro
  186.                 mov     ax,2A00H
  187.                 int     21H
  188.                 endm
  189.  
  190. set_date        macro   year,month,day
  191.                 mov     cx,year
  192.                 mov     dh,month
  193.                 mov     dl,day
  194.                 mov     ax,2B00H
  195.                 int     21H
  196.                 endm
  197.  
  198. get_time        macro
  199.                 mov     ax,2C00H
  200.                 int     21H
  201.                 endm
  202.  
  203. set_time        macro   hours,minutes,seconds,hundredths
  204.                 mov     ch,hour
  205.                 mov     cl,minutes
  206.                 mov     dh,seconds
  207.                 mov     dl,hundredths
  208.                 mov     ax,2D00H
  209.                 int     21H
  210.                 endm
  211.  
  212. verify          macro   switch
  213.                 mov     al,switch
  214.                 mov     ah,2EH
  215.                 int     21H
  216.                 endm
  217.  
  218. get_dta         macro
  219.                 mov     ah,2F00H
  220.                 int     21H
  221.                 endm
  222.  
  223. get_version     macro
  224.                 mov     ax,3000H
  225.                 int     21H
  226.                 endm
  227.  
  228. ctrl_c_ck       macro   action,state
  229.                 mov     al,action
  230.                 mov     dl,state
  231.                 mov     ax,3300H
  232.                 int     21H
  233.                 endm
  234.  
  235. get_vector      macro   interrupt
  236.                 mov     al,interrupt
  237.                 mov     ax,3500H
  238.                 int     21H
  239.                 endm
  240.  
  241. get_disk_space  macro   drive
  242.                 mov     dl,drive
  243.                 mov     ax,3600H
  244.                 int     21H
  245.                 endm
  246.  
  247. make_dir        macro   path
  248.                 mov     dx,offset path
  249.                 mov     ax,3900H
  250.                 int     21H
  251.                 endm
  252.  
  253. rem_dir         macro   path
  254.                 mov     dx,offset path
  255.                 mov     ax,3A00H
  256.                 int     21H
  257.                 endm
  258.  
  259. change_dir      macro   path
  260.                 mov     dx,offset path
  261.                 mov     ax,3B00H
  262.                 int     21H
  263.                 endm
  264.  
  265. create_handle   macro   path,attrib
  266.                 mov     dx,offset path
  267.                 mov     cx,attrib
  268.                 mov     ax,3C00H
  269.                 int     21H
  270.                 endm
  271.  
  272. open_handle     macro   path,access
  273.                 mov     dx,offset path
  274.                 mov     al,access
  275.                 mov     ah,3DH
  276.                 int     21H
  277.                 endm
  278.  
  279. close_handle    macro   handle
  280.                 mov     bx,handle
  281.                 mov     ax,3E00H
  282.                 int     21H
  283.